<template>
  <div class="login-nav">
    <p class="tip" v-if="index === 'loginScreen'">
      <a @click="changeNav('registerScreen')">我有账号</a>
    </p>
    <p class="tip" v-else>
      <a @click="changeNav('loginScreen')">我是新用户</a>
    </p>
  </div>
</template>

<script>
export default {
  props: {
    index: {
      type: String,
      default: 'loginScreen'
    }
  },
  methods: {
    changeNav (index) {
      this.$emit('change-nav', index)
    }
  },
  computed: {
    isLogin () {
      return this.index === 'loginScreen'
    }
  }
}
</script>

<style lang="less" scoped>
.tip {
  font-size: 14px;
  color: #8395a7;
  text-align: right;

  a {
    color: #eba613;
    cursor: pointer;
    text-decoration: underline;
    display: inline-block;

    &:hover {
      color: #05634b;
    }
  }
}
</style>
